import { createWebHashHistory, Router, createRouter } from "vue-router";
import routes from "./routes";

const router: Router = createRouter({
  history: createWebHashHistory(),
  routes,
});

router.beforeEach((to, from, next) => {
  const title = to.meta.title as string;
  to.meta.title && (document.title = title);
  next();
});

export default router;
